package controlador;

import java.awt.event.ActionEvent;
import java.awt.event.ActionListener;

import vista.MenuReportes;


public class ControladorMenuReportes implements ActionListener{

	private MenuReportes menuReportes;
	private ControladorReporteVentas controladorReportesVentas;
	private ControladorReporteIngredientes controladorReporteIngredientes;
	private ControladorReporteIngMasUsado controladorReporteIngMasUsado;

	public ControladorMenuReportes() {
		super();
		this.menuReportes = new MenuReportes();
		this.menuReportes.addListener(this);
		this.menuReportes.setLocationRelativeTo(null);
		this.menuReportes.setVisible(true);
	}

	@Override
	public void actionPerformed(ActionEvent e) {
		if (e.getActionCommand().equals("VentaProductos")){
			controladorReportesVentas = new ControladorReporteVentas();
		}
		else if (e.getActionCommand().equals("CantidadDisponible")){
			controladorReporteIngredientes = new ControladorReporteIngredientes();
		}
		else if(e.getActionCommand().equals("IngredientesMasUsados")){
			controladorReporteIngMasUsado = new ControladorReporteIngMasUsado();
		}
		else if (e.getActionCommand().equals("Salir")){
			menuReportes.dispose();			
		}
	}
}
